﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

namespace MSDNWebcast.Media
{
    [ComImport, CoClass(typeof(MediaDetClass)), Guid("65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA")]
    public interface MediaDet : IMediaDet
    {

    }

    //[ComVisible(true), ComImport,
    //    Guid("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA"),
    //    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [ComImport, InterfaceType((short)1), Guid("65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA")]
    public interface IMediaDet
    {
        //[PreserveSig]
        //int get_Filename(/* [retval][out] */ out string pVal);

        [PreserveSig]
        int put_Filename(/* [in] */ string newVal);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void WriteBitmapBits(double streamTime, int Width, int Height, [MarshalAs(UnmanagedType.BStr)] string Filename);
    }


    [ComImport, Guid("65BD0711-24D2-4FF7-9324-ED2E5D3ABAFA"), TypeLibType((short)2), ClassInterface((short)0)]
    public class MediaDetClass : IMediaDet, MediaDet
    {

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        public virtual extern void WriteBitmapBits(double streamTime, int Width, int Height, [MarshalAs(UnmanagedType.BStr)] string Filename);

        //[PreserveSig]
        //public extern int get_Filename(/* [retval][out] */ out string pVal);

        [PreserveSig]
        public extern int put_Filename(/* [in] */ string newVal);
    }

}
